import Nav from '../../src/components/common/nav/nav.vue'
import {ApiUrl,Islogined,returnId,show,hide} from './ApiUrl.js'
import loading from '../../src/components/common/loading/loading.vue'
import fangerror from '../../src/components/common/fangerror/fangerror.vue'
import {timerScale} from '../plugins/scale/self_adaption_scale'
require("./lib/select2/js/select2.min");
import Vue from 'vue'
import VueScroller from 'vue-scroller'
Vue.use(VueScroller)
import Swiper from "../plugins/swiper4x/swiper.min";

export default {
  components: {
    meun:Nav,loading,fangerror,
  },
  data(){
    return {
      FangLoading:false,//Loading控制，true显示，false不显示
      fangerroring:false,//提示文本弹窗，true显示，false不显示
      fangerrorText:'',//提示文本弹窗内容
      headerTitle:{username:'',tyep:'车站'},
      newUser:false,  //是否是新用户
      xlink:'#',//icon font 的# :xlink:href
      isChoose:false,
      dataQuerybyspecialtycodeList:[],  //接收数据数组
      specificNum:'38',
      specificUnit:'km',
      locationInfo:'广州市-市区',
      specififMode:'明挖车站',
      moreInfo:'默认运距 | 地下车站 1-3层 | 二类土质 | 抗震等级 3级 | 山体平整',
      IndexsubList:[],//我的指标列表
      industryCodeWindList:[],
      IndexcategoryList:[],//指标分类关键字搜索列表
      industryCodeList:[],//
      noData:'',
      IndexAttrList:[],//指标属性列表
      QuerybyspecialtycodendexName:'',//弹窗步骤2标题 indexName
      indexListPage:2,//主列表页码数
      // specialtyCode:null,//主列表专业类型编号
      industryCode:null,//专业类型
      indexType:null,//专业类型
      svaespecialtyCode:'',//设置特征专业
      Listlevel:['','一','二','三','四','五','六','七','八','九','十'],//主列表等级
      SavepageList:{saveindexpage:2,savefeaturepage:2,specialtyCode:null,},//弹窗设置page 页码数
      specialtyindex:'',//获取专业的下标
      specialtyindexType:null,//
      PassByValue:'',//传给子页面specialtyCode
      totalCount:{
        indexsublist:0,
        IndexAttrList:0,
        dataQuerybyspecialtycodeList:0,
      },//对应接口数据条数
    }
  },
  created: function() {

  },
  mounted(){
    let _This = this;
    timerScale();
    _This.headerTitle.tyep = '常用';
    // 判断是否为首次
    this.getisfirstsub(function (data) {
      _This.newUser = data.status;
       // _This.newUser = true;
      if(_This.newUser){  //是新用户
        _This.popShow();
        // 用户信息
        let UserDataInfo = {
          userName:true,
          chName:true,
        }
        _This.getUserInfo(UserDataInfo,function (data) {
          _This.headerTitle.username = data.chName;
          localStorage.setItem('userName',data.chName);
        })
        _This.FangLoading = true;
        _This.getQuerybyIndustrycode('',true,null,1,30,function (data) {
          _This.industryCodeWindList = data;
          _This.specialtyindexType = data[0].indexType;

          _This.specialtyindex = 0;
          _This.PassByValue = data[0].specialtyCode;
          _This.SavepageList.specialtyCode = data[0].specialtyCode;
          _This.industryCode = data[0].industryCode;
          _This.indexType = data[0].indexType;
          setTimeout(() => {
            new Swiper('#iconListBox', {
              slidesPerView: 3,
            });
            //回调选中数据 specialtyCode,indexType,parent,page,pageSize,fn
            _This.getquerybyspecialtycodeList(data[0].indexCode,3,true,1,10,function (data) {
              console.log(data);
              _This.dataQuerybyspecialtycodeList = data;
              /*_This.IndexsubList  = data;*/
            });

          });
          _This.$nextTick(() =>{
            _This.$refs.indexsublist.finishInfinite(false);
            _This.getIndexsubList('',1,10,function (data) {
              _This.IndexsubList = data;
            })
          })
        });
      }else{
        //回调根据industryCode 进行查询
        _This.$nextTick(() =>{
          // 用户信息
          let UserDataInfo = {
            userName:true,
            chName:true,
          }
          _This.getUserInfo(UserDataInfo,function (data) {
            _This.headerTitle.username = data.chName;
            localStorage.setItem('userName',data.chName);
          })
          _This.FangLoading = true;
          let FangUpadateIndexSorting = localStorage.getItem('FangUpadateIndexSorting');
          let GetQuerybyLIndustryCode = '';
          if(FangUpadateIndexSorting != '' && FangUpadateIndexSorting != null && FangUpadateIndexSorting != undefined){
            GetQuerybyLIndustryCode = localStorage.getItem('FangUpadateIndexSorting');
          }else {
            GetQuerybyLIndustryCode = '03'
          }
          _This.getQuerybyIndustrycode(GetQuerybyLIndustryCode,true,null,1,30,function (data) {
            _This.industryCodeList = data;
            _This.specialtyindexType = data[0].indexType;

            _This.specialtyindex = 0;
            _This.PassByValue = data[0].specialtyCode;
            _This.SavepageList.specialtyCode = data[0].specialtyCode;
            _This.industryCode = data[0].industryCode;
            _This.indexType = data[0].indexType;
            if(_This.newUser){
              setTimeout(() => {
                new Swiper('#iconListBox', {
                  slidesPerView: 3,
                });
                //回调选中数据 specialtyCode,indexType,parent,page,pageSize,fn
                _This.getquerybyspecialtycodeList(data[0].indexCode,3,true,1,10,function (data) {
                  console.log(data);
                  _This.dataQuerybyspecialtycodeList = data;
                  /*_This.IndexsubList  = data;*/
                });

              });
            }
            _This.$nextTick(() =>{
              _This.$refs.indexsublist.finishInfinite(false);
              _This.getIndexsubList('',1,10,function (data) {
                _This.IndexsubList = data;
              })
            })
          });
        })
      }
    })

    $('.select2-dropdown').remove();
    $('select').select2({
      language: "zh-CN",
    });
  },
  methods:{
    setTimeoutError:function () {
      setTimeout(() => {
        $('.Fang_errorBox').hide()
        this.fangerroring = false
      }, 2000)
    },
    show:function(target){
      show(target);
      $('.crosswise-select-choose .select2-container').width($('.crosswise-select-choose li:first').outerWidth(true) - 6);
    },
    /*第二个弹窗保存事件*/
    hide:function(target,e){
      let eT = e.currentTarget;
      let _This = this;
      /*
      * specialtyCode	是	string	专业
        indexAttrSubList[0].attrId	是	int	特征id
        indexAttrSubList[0].attrValue	是	string	特征值
      *
      * */
      let FeaturesSaveData = {
        specialtyCode:this.svaespecialtyCode,
      }
      let needChoosed = eT.parentNode.children[0].children[1].children[1].children;
      let needChoosedArray = [];
      //必选特征
      for(let i = 0;i < needChoosed.length; i++){
        needChoosedArray.push({
          attrValue:needChoosed[i].children[1].children[0].value,
          attrId:needChoosed[i].children[1].children[0].getAttribute('data-attrid')
        });
      }
      if(needChoosedArray.length == 0){
        _This.fangerroring = true;
        _This.fangerrorText = '请选择您关注的特征';
        _This.setTimeoutError();
        return
      }
      //可选特征
      let KeChoosed = eT.parentNode.children[0].children[3].children[0].children[0].children[0].children;
      // console.log(KeChoosed)
      for(let i = 0;i < KeChoosed.length; i++){
        if(KeChoosed[i].className.indexOf('cur') > -1){
          needChoosedArray.push({
            attrValue:KeChoosed[i].children[2].children[0].value,
            attrId:KeChoosed[i].children[2].children[0].getAttribute('data-attrid')
          });
        }
      }
      // 处理为后台需要的格式
      for(let i = 0; i < needChoosedArray.length; i++ ){
        FeaturesSaveData["indexAttrSubList["+ i + "].attrValue"] = needChoosedArray[i].attrValue;
        FeaturesSaveData["indexAttrSubList["+ i + "].attrId"] = needChoosedArray[i].attrId;
      }
      // console.log(FeaturesSaveData)

      _This.SaveFeatures(FeaturesSaveData,function (data) {
        _This.fangerroring = true;
        _This.fangerrorText = data.msg;
        _This.setTimeoutError();
        _This.getIndexsubList('',1,10,function (data) {
          _This.IndexsubList = data;
        })
        hide(target);
      })
    },
    clickTitle: function(specialtyCode,index,industryCode){
      this.$router.push({path:'feature?specialtyCode='+specialtyCode + '&index='+index + '&industryCode=' + industryCode});
    },
    addProject: function(specialtyCode,index,industryCode){
      this.$router.push({path: 'engineering_index?specialtyCode='+specialtyCode + '&index=' + index + '&industryCode=' + industryCode});
    },
    popShow:function () {
      show('#zhibiao_pop');
    },
    //主列表上拉加载更多数据
    infinite(done) {
      let _This = this;
 /*     if(this.noData) {
        setTimeout(() => {
          _This.$refs.indexsublist.finishInfinite(2);
        })
        return;
      }*/

      setTimeout(() => {
        _This.$nextTick(()=>{
          if(_This.totalCount.indexsublist > 10){
            _This.getIndexsubList(_This.specialtyCode,_This.indexListPage,10,function (data) {
              if(data=='' || data == null){
                done(true);//没有更多数据
              }else {
                _This.indexListPage =  _This.indexListPage + 1;
                done();
              }
              if(_This.IndexsubList == ''){
                _This.IndexsubList = data;
              }else {
                for(let key in data){
                  _This.IndexsubList.push(data[key]);
                }
                 // console.log(_This.IndexsubList)
              }
            });
          }
        })
      }, 500)
      //回调选中数据 specialtyCode,indexType,parent,page,pageSize,fn

    },
    //第一个弹窗上拉加载更多数据 -- 设置指标
    SaveIndexinfinite(done) {
      let _This = this;
      /*if(this.noData) {
        setTimeout(() => {
          _This.$refs.SaveIndexlist.finishInfinite(2);
        })
        return;
      }*/
      /* SavepageList:{saveindexpage:1,savefeaturepage:1},//弹窗设置page 页码数*/
      /*_This.SavepageList.specialtyCode = data[0].specialtyCode;*/
      setTimeout(() => {
        _This.$nextTick(()=>{
          if(_This.totalCount.dataQuerybyspecialtycodeList > 10){
            _This.getquerybyspecialtycodeList( _This.SavepageList.specialtyCode,3,true, _This.SavepageList.saveindexpage,10,function (data) {
              if(data=='' || data == null){
                done(true);//没有更多数据
              }else {
                _This.SavepageList.saveindexpage =   _This.SavepageList.saveindexpage + 1;
                done();
              }
              if(_This.dataQuerybyspecialtycodeList == ''){
                _This.dataQuerybyspecialtycodeList = data;
              }else {
                for(let key in data){
                  _This.dataQuerybyspecialtycodeList.push(data[key]);
                }
                // console.log(_This.dataQuerybyspecialtycodeList)
              }
            });
          }
        })
      }, 500)
      //回调选中数据 specialtyCode,indexType,parent,page,pageSize,fn

    },
    //第二个弹窗上拉加载更多数据 -- 设置特征
    Savefeatureinfinite(done) {
      let _This = this;
      if(this.noData) {
        setTimeout(() => {
          _This.$refs.Savefeaturelist.finishInfinite(2);
        })
        return;
      }
      /* SavepageList:{saveindexpage:1,savefeaturepage:1},//弹窗设置page 页码数*/
      /*_This.SavepageList.specialtyCode = data[0].specialtyCode;*/
      setTimeout(() => {
        _This.$nextTick(()=>{
          if(_This.totalCount.IndexAttrList > 10){
            _This.getIndexAttrList(_This.SavepageList.specialtyCode,_This.SavepageList.savefeaturepage,10,function (data) {
              if(data=='' || data == null){
                done(true);//没有更多数据
              }else {
                _This.SavepageList.savefeaturepage =   _This.SavepageList.savefeaturepage + 1;
                done();
              }
              if(_This.IndexAttrList == ''){
                _This.IndexAttrList = data;
              }else {
                for(let key in data){
                  _This.IndexAttrList.push(data[key]);
                }
                // console.log(_This.IndexAttrList)
              }
              _This.$nextTick(() => {
                $('#SavefeatureBox select').select2({
                  language: "zh-CN",
                });
              })
            });
          }
        })
      }, 500)
      //回调选中数据 specialtyCode,indexType,parent,page,pageSize,fn

    },
    //第一个弹窗
    clickHide:function (dom1,dom2,e) {
      let _This = this;

      let chooseIconActiveText = document.getElementsByClassName('chooseIconActive')[0].childNodes[0].lastChild.innerText
      _This.QuerybyspecialtycodendexName = chooseIconActiveText;
      //获取专业码
      let ActiveIcon = e.currentTarget.parentNode.children[0].children[1].children[0].children;
      let ActiveDataCode = '';
      for(var i=0;i<ActiveIcon.length;i++){
        if(ActiveIcon[i].className.indexOf('chooseIconActive') > -1){
          ActiveDataCode = ActiveIcon[i].getAttribute('data-indexcode'); //得到专业码
        }
      }
      //获取推荐指标
      /*indexType	是	int	指标类型:1 单项经济指标,2 专业经济指标,3 分部经济指标 ,4 其它费用经济指标,5工程量技术,6 材料消耗量
      specialtyCode	是	String	专业编码
      indexSubList[0].indexType	是	string	指标类型
      indexSubList[0].indexCode	是	string	指标编码
      indexSubList[0].indexName	是	string	指标名称
      *
      * */
      let indexSubList = [];
      let specialtyCode = ActiveDataCode;
      _This.svaespecialtyCode = ActiveDataCode;
      let SaveDataList = {
        indexType:_This.specialtyindexType,
        specialtyCode:specialtyCode,
      }
      let ChoosedIndexBox = document.getElementById('ChoosedIndexBox').getElementsByClassName('cur');
      //判断有无选择指标
      if(ChoosedIndexBox.length == 0){
        _This.fangerroring = true;
        _This.fangerrorText = '请选择指标';
        _This.setTimeoutError();
        return;
      }

      let ActiveCur = e.currentTarget.parentNode.children[0].children[4].children[0].children[0].children[0].children;
      for(var i=0;i<ActiveCur.length;i++){
        if(ActiveCur[i].className.indexOf('cur') > -1){
          indexSubList.push({
            indexType:ActiveCur[i].getAttribute('data-indextype'),
            indexCode:ActiveCur[i].getAttribute('data-indexcode'),
            indexName:ActiveCur[i].getAttribute('data-indexname'),
          }); //得到选中推荐指标列表
        }
      }
      for(let i = 0;i < indexSubList.length;i++){
        SaveDataList["indexSubList["+ i + "].indexType"] = indexSubList[i].indexType;
        SaveDataList["indexSubList["+ i + "].indexCode"] = indexSubList[i].indexCode;
        SaveDataList["indexSubList["+ i + "].indexName"] = indexSubList[i].indexName;
      }

      //保存传值回调
      this.SaveIndexSub(SaveDataList,function(data){
        _This.fangerroring = true;
        _This.fangerrorText = data.msg;
        _This.setTimeoutError();
        $(dom1).fadeOut(200,function () {
          $(dom2).show();
          /*指标属性列表
          * indexCode	是	string	指标编码
            page	是	int	分页页数
            pageSize	是	int	分页条数
          * */

          let FangUpadateIndexSorting = localStorage.getItem('FangUpadateIndexSorting');
          let GetQuerybyLIndustryCode = '';
          if(FangUpadateIndexSorting != '' && FangUpadateIndexSorting != null && FangUpadateIndexSorting != undefined){
            GetQuerybyLIndustryCode = localStorage.getItem('FangUpadateIndexSorting');
          }else {
            GetQuerybyLIndustryCode = '03'
          }
          _This.getQuerybyIndustrycode(GetQuerybyLIndustryCode,true,null,1,30,function (data) {
            _This.industryCodeList = data;
            _This.specialtyindexType = data[0].indexType;

            _This.specialtyindex = 0;
            _This.PassByValue = data[0].specialtyCode;
            _This.SavepageList.specialtyCode = data[0].specialtyCode;
            _This.industryCode = data[0].industryCode;
            _This.indexType = data[0].indexType;
            if(_This.newUser){
              setTimeout(() => {
                new Swiper('#iconListBox', {
                  slidesPerView: 3,
                });
                //回调选中数据 specialtyCode,indexType,parent,page,pageSize,fn
                _This.getquerybyspecialtycodeList(data[0].indexCode,3,true,1,10,function (data) {
                  console.log(data);
                  _This.dataQuerybyspecialtycodeList = data;
                  /*_This.IndexsubList  = data;*/
                });

              });
            }
            _This.$nextTick(() =>{
              _This.$refs.indexsublist.finishInfinite(false);
              _This.getIndexsubList('',1,10,function (data) {
                _This.IndexsubList = data;
              })
            })
          });

          _This.getIndexAttrList(specialtyCode,1,10,function (data) {
            _This.IndexAttrList = data;
            _This.$nextTick(() => {
              $('select').select2({
                language: "zh-CN",
              });
              $('.crosswise-select-choose .select2-container').width($('.crosswise-select-choose li:first').outerWidth(true) - 6);
              hide(dom1);
            })

          })
        });
      })

    },
    BindBoxWrapHide(){
      $('#zhibiao_pop').show();
      this.$refs.BoxWrapHide.style = 'display:none;'
    },
    //您的第一个指标列表 -- 选中Iocn样式改变
    bindClickIschooseIcon:function(e,specialtyCode,indexType,industryCode){
      let _This = this;
      _This.SavepageList.saveindexpage = 1;
      _This.specialtyindexType = indexType;
      _This.SavepageList.specialtyCode = specialtyCode;
      _This.$refs.SaveIndexlist.scrollTo(0,0,false);
      _This.$refs.SaveIndexlist.finishInfinite(false);
      localStorage.setItem('FangUpadateIndexSorting',industryCode);
      _This.getquerybyspecialtycodeList(specialtyCode,3,true,1,10,function (data) {
        _This.dataQuerybyspecialtycodeList = data;
      });
      let eT = e.currentTarget;
      let childDom  = eT.parentNode.children;
      let ListParent = eT.parentNode.parentNode.parentNode.children[4].children[0].children[0].children[0].children;
      console.log(eT.parentNode.parentNode.parentNode.children[4].children[0].children[0].children[0].children);
      for(let i = 0;i < childDom.length;i++){
        childDom[i].classList.remove('chooseIconActive');//先删除所有含有active 类名
      }
      for (let i = 0; i < ListParent.length; i++){
        ListParent[i].children[0].children[2].classList.remove('cur');
      }
      eT.classList.add('chooseIconActive');//单独添加active 类名
      ListParent[0].children[0].children[2].classList.add('cur');
    },
    //请操作您的第一个指标列表 选择--是否选中
    chooseNorm:function (e) {
      /*item.choose = !item.choose*/
      let eT = e.currentTarget;
      /*console.log(eT)*/
      let LiClassLe = eT.classList;
      let IsLiHasClass = eT.classList[LiClassLe.length-1]
      let ClassL = eT.children[0].children[2].classList;
      let IsHasClass = eT.children[0].children[2].classList[ClassL.length-1];
      eT.firstChild.childNodes[4].classList.add('cur');
      eT.classList.add('cur');//整个LI的添加cur类
      if(IsHasClass == 'cur'){
        eT.firstChild.childNodes[4].classList.remove('cur');
      }
      if(IsLiHasClass == 'cur'){
        eT.classList.remove('cur');
      }
    },
    //选择关注的特征弹窗 - - 非必须主特征选择事件
    bindClickVerticalChoose:function(e){
      let eT = e.currentTarget;
      let ClassL =  eT.classList;
      let IsHasClass = eT.classList[ClassL.length-1];
      eT.parentNode.classList.add('cur');
      eT.classList.add('cur');
      if(IsHasClass == 'cur'){
        eT.classList.remove('cur');
        eT.parentNode.classList.remove('cur');
      }
    },
    //点击左边专业高亮样式
    bindQuerybyIndustryCode:function(e,indexCode,index,indexNmae){
      let _This = this;
      _This.indexListPage = 1;
      _This.specialtyindex = index;
      _This.$refs.indexsublist.scrollTo(0,0,false);
      _This.specialtyCode = indexCode;
      if(indexCode == ''){
        _This.PassByValue = _This.industryCodeList[0].indexCode
      }else {
        _This.PassByValue = indexCode;
      }
      _This.headerTitle.tyep = indexNmae;
      //回调选中数据 specialtyCode,indexType,parent,page,pageSize,fn
      _This.indexListPage =  _This.indexListPage + 1;
      _This.getIndexsubList(_This.specialtyCode,1,10,function (data) {
        _This.IndexsubList = data;
        _This.$refs.indexsublist.finishInfinite(false);
      })
      let eT = e.currentTarget;
      let childDom  = eT.parentNode.children;
      for(let i = 0;i < childDom.length;i++){
        childDom[i].classList.remove('codeActive');//先删除所有含有codeActive 类名
      }
      eT.classList.add('codeActive');
    },
    //跳转设置指标
    Totarget_set:function () {
      let _This = this;
      this.$router.push({path:'target_set?specialtyCode='+ _This.PassByValue+'&indexType='+_This.indexType+'&industryCode='+_This.industryCode});
    },
    //跳转详情
    Todetail:function (id,indexCode,indexType,refCount) {
      if(refCount !=0 ){
        this.$router.push({path:'detail?id='+ id+'&indexCode='+indexCode+'&indexType='+indexType});
      }else {
        this.fangerroring = true;
        this.fangerrorText = '暂无指标推荐';
        this.setTimeoutError();
      }
    },
    /*
    * 判断用户是否设置过 -已完成
      简要描述：
      是否首次设置指标
      请求URL：
      /api/isfirstsub
      请求方式：
      GET
    * */
    getisfirstsub:function(fn){
      this.FnAxiosAjax('get','/api/isfirstsub',{},function (data) {
        !! fn && fn(data.results);
      })
    },
    /*
    * 根据industryCode 进行查询 -已完成
      简要描述：
      根据industryCode查询指标
      请求URL：
      /api/indexcategory/querybyindustrycode
      请求方式：
      POST
      参数：
      参数名	必选	类型	说明
      industryCode	false	string	03 轨道工程，02 运营类，01房产类
      subStatus	false	boolean	是否需要查看用户关注状态
      indexType	false	int	1 单项经济指标,2 专业经济指标,3 分部经济指标 ,4 其它费用经济指标,5工程量技术,6 材料消耗量
      page	true	int	页码
      pageSize	true	int	页面大小
    *
    * */
    getQuerybyIndustrycode:function(industryCode,subStatus,indexType,page,pageSize,fn){
      this.FnAxiosAjax('post','/api/indexcategory/querybyindustrycode',{industryCode,subStatus,indexType,page,pageSize},function (data) {
        !! fn && fn(data.results);
      })
    },
    /*
    * 专业类型编号查询 -已完成
    简要描述：
    根据 专业类型编号 查询指标
    请求URL：
    /api/indexcategory/querybyspecialtycode
    请求方式：
    POST
    参数：
    参数名	必选	类型	说明
    specialtyCode	true	string	专业类型编号
    indexType	true	int	指标类型
    parent	false	boolean	是否包含父级信息
    page	true	int	页码
    pageSize	true	int	页面大小
    *
    * */
    getquerybyspecialtycodeList:function(specialtyCode,indexType,parent,page,pageSize,fn){
      let _This = this;
      this.FnAxiosAjax('post','/api/indexcategory/querybyspecialtycode',{specialtyCode,indexType,parent,page,pageSize},function (data) {
        !! fn && fn(data.results);
        _This.totalCount.dataQuerybyspecialtycodeList = data.totalCount;
      })
    },
    /*
    * 指标属性列表-已完成
      简要描述：
      获取指标下面属性信息
      请求URL：
      /api/indexattr/list
      请求方式：
      POST
      参数：
      参数名	必选	类型	说明
      specialtyCode	是	string	指标编码
      page	是	int	分页页数
      pageSize	是	int	分页条数
    *
    * */
    getIndexAttrList:function(specialtyCode,page,pageSize,fn){
      let _This = this;
      this.FnAxiosAjax('post','/api/indexattr/list',{specialtyCode,page,pageSize},function (data) {
        !! fn && fn(data.results);
        _This.totalCount.IndexAttrList = data.totalCount
      })
    },
    /*
    *
    * 我的指标列表
    简要描述：
    我的指标列表
    请求URL：
    /api/indexsub/list
    请求方式：
    POST
    参数：
    参数名	必选	类型	说明
    page	是	int	当前页
    pageSize	是	int	页面大小
    industryCode	否	string	分类，03 轨道工程，02 运营类，01房产类
    specialtyCode	否	string	专业类型编号
    sortType	否	int	排序方式 预留
    *
    *
    * */
    getIndexsubList:function (specialtyCode,page,pageSize,fn) {
      let _This = this;
      this.FnAxiosAjax('post','/api/indexsub/list',{specialtyCode,page,pageSize},function (data) {
          !! fn && fn(data.results);
          _This.totalCount.indexsublist = data.totalCount;
      })
    },
    /*
    * 设置个人首个指标-已完成
      简要描述：
      操作个人首个指标
      请求URL：
      /api/indexsub/save
      请求方式：
      POST
      参数：
      参数名	必选	类型	说明
      indexType	是	int	指标类型:1 单项经济指标,2 专业经济指标,3 分部经济指标 ,4 其它费用经济指标,5工程量技术,6 材料消耗量
      specialtyCode	是	String	专业编码
      indexSubList[0].indexType	是	string	指标类型
      indexSubList[0].indexCode	是	string	指标编码
      indexSubList[0].indexName	是	string	指标名称

      indexSubList:[
        {indexType:1,indexCode:1,indexName:1123},
      ]
    *
    * */
    SaveIndexSub:function(dataList,fn){
      console.log(dataList)
      this.FnAxiosAjax('post','/api/indexsub/save',dataList,function (data) {
        !! fn && fn(data);
      })
    },
    /*
    * 保存我的指标特征-已完成
      简要描述：
      保存我的指标特征
      请求URL：
      /api/indexsub/saveFeatures
      请求方式：
      POST
      参数：
      参数名	必选	类型	说明
      specialtyCode	是	string	专业
      indexAttrSubList[0].attrId	是	int	特征id
      indexAttrSubList[0].attrValue	是	string	特征值
    *
    * */
    SaveFeatures:function(indexAttrSubList,fn){
      this.FnAxiosAjax('post','/api/indexsub/saveFeatures',indexAttrSubList,function (data) {
        !! fn && fn(data);
      })
    },
    /*
    * 获取登录用户信息
      简要描述：
      用户注册接口
      请求URL：
      /api/user/info
      请求方式：
      get
      参数
      参数名	必选	类型	说明
      userName	否	boolean	是否需要用户名
      chName	否	boolean	是否需要中文名字
      uuvId	否	boolean	uuvid
      orgId	否	boolean	uuv同步的部门id
    *
    *
    * */
    getUserInfo:function(userDataInfo,fn){
      this.FnAxiosAjax('post','/api/user/info',userDataInfo,function (data) {
        !! fn && fn(data.results);
      })
    },

  }
}
